// integral_shop/pages/detail/index.js
import {Model} from '../model.js';
var model =new Model();

Page({

  /**
   * 页面的初始数据
   */
  data: {
    indicatorDots: true,
    indicator_color: '#fff',
    indicator_active_color: '#e60012',
    vertical: false,
    autoplay: false,
    circular: false,
    interval: 2000,
    duration: 500,
    number:1
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var id=options.id;
    model.getIntegralInfo(id,(res)=>{
      this.setData({info:res.data})
    })
   
  },
  // 回首页
  clickHome:function(){
    wx.switchTab({
      url: '/pages/index/index',
    })
  },

  // 增加数量
  clickNumber({ detail }) {
    this.setData({
      number: detail.value
    })
  },
  // 下单
  clickOrder(e){
    var id = e.currentTarget.dataset.id;
    var number=this.data.number;
    wx.navigateTo({
      url: '../order/index?id=' + id + '&number=' + number,
    })
  }
})